package com.shanglida.main;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import com.shanglida.R;
import com.shanglida.base.BaseActivity;
import com.shanglida.main.find.CaptureActivity;
import com.shanglida.main.find.WebActivity;
import com.shanglida.main.find.WeixinActivity;

public class TabFind extends BaseActivity {
	// 扫描二维码控件
	private ImageView mcode, mweb, mweixin;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tab_find);
		initView();
		initData();
	}

	@Override
	protected void initData() {
		mcode.setOnClickListener(this);
		mweb.setOnClickListener(this);
		mweixin.setOnClickListener(this);
	}

	@Override
	protected void initView() {
		mcode = (ImageView) findViewById(R.id.qrcsweep);
		mweb = (ImageView) findViewById(R.id.qrcviews);
		mweixin = (ImageView) findViewById(R.id.qrcnime);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		// 跳转扫描二维码
		case R.id.qrcsweep:
			Intent Code = new Intent();
			Code.setClass(TabFind.this, CaptureActivity.class);
			startActivity(Code);
			break;
		// 跳转Web
		case R.id.qrcviews:
			Intent Web = new Intent();
			String m_url = "http://m.51m51m.cn/";
			Web.putExtra("URL", m_url);
			Web.setClass(TabFind.this, WebActivity.class);
			startActivityForResult(Web, RESULT_OK);
			// Log.i(">>>---", "URL" + m_url);
			break;
		// 启动微网站
		case R.id.qrcnime:
			Intent Weixin = new Intent();
			Weixin.setClass(TabFind.this, WeixinActivity.class);
			startActivity(Weixin);
			break;

		default:
			break;
		}

	}
}
